package service;

import dao.PersonalDaoImpl;
import dao.Personaldao;
import entity.Page;
import entity.PersonalFile;

import java.util.List;

/**
 * @author 孙亚梅
 * @version V1.0
 * @Project javase2203
 * @Package service
 * @Description:
 * @Date 2022/5/27 13:38
 */
public class PersonalFileServiceImpl implements  PersonalFileService {
    private Personaldao personaldao = new PersonalDaoImpl();


    @Override
    public List<PersonalFile> getAll() {

        return personaldao.selectAll();
    }

    @Override
    public boolean addPersonalFile(PersonalFile personalFile) {
        return personaldao.addOne(personalFile) >0;
    }

    @Override
    public boolean deletePersonFile(String personalFileId) {
        return personaldao.deleteOne(personalFileId)>0;
    }

    @Override
    public PersonalFile getPersonalFile(String personalFileId) {

        return personaldao.selectOne(personalFileId);
    }

    @Override
    public boolean updatePersonalFile(PersonalFile personalFile) {

        return personaldao.updateOne( personalFile)>0;
    }

    @Override
    public List<PersonalFile> findAllPage(Page page) {
       List<PersonalFile> list =personaldao.selectAllByPage(page);

        return list;
    }

    @Override
    public int finAllPageCount() {

        int count = personaldao.selectAllByPageCount();
        return count;
    }


}
